package com.cn.hu.entity;

import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * User entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "user", catalog = "huarui")
public class User implements java.io.Serializable {

	// Fields

	private Integer id;
	private String account;
	private String password;
	private Integer ruleId;
	private Timestamp createDate;
	private Timestamp modifyDate;
	private Integer status;
	private String bak;

	//add,not save database
	private UserRule rule;
	private List<UserRuleMenu> menuList;
	
	// Constructors

	/** default constructor */
	public User() {
	}

	/** minimal constructor */
	public User(String account, String password, Integer ruleId,
			Timestamp createDate) {
		this.account = account;
		this.password = password;
		this.ruleId = ruleId;
		this.createDate = createDate;
	}

	/** full constructor */
	public User(String account, String password, Integer ruleId,
			Timestamp createDate, Timestamp modifyDate, Integer status,
			String bak) {
		this.account = account;
		this.password = password;
		this.ruleId = ruleId;
		this.createDate = createDate;
		this.modifyDate = modifyDate;
		this.status = status;
		this.bak = bak;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "account", nullable = false, length = 20)
	public String getAccount() {
		return this.account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "password", nullable = false, length = 20)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "rule_id", nullable = false)
	public Integer getRuleId() {
		return this.ruleId;
	}

	public void setRuleId(Integer ruleId) {
		this.ruleId = ruleId;
	}

	@Column(name = "create_date", nullable = false, length = 19)
	public Timestamp getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Timestamp createDate) {
		this.createDate = createDate;
	}

	@Column(name = "modify_date", length = 19)
	public Timestamp getModifyDate() {
		return this.modifyDate;
	}

	public void setModifyDate(Timestamp modifyDate) {
		this.modifyDate = modifyDate;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "bak", length = 100)
	public String getBak() {
		return this.bak;
	}

	public void setBak(String bak) {
		this.bak = bak;
	}

	@Transient
	public UserRule getRule() {
		return rule;
	}

	public void setRule(UserRule rule) {
		this.rule = rule;
	}

	@Transient
	public List<UserRuleMenu> getMenuList() {
		return menuList;
	}

	public void setMenuList(List<UserRuleMenu> menuList) {
		this.menuList = menuList;
	}

	
}